#pragma once
// MESSAGE XAP_SBG_UTC_MSG PACKING

#define MAVLINK_MSG_ID_XAP_SBG_UTC_MSG 20802


typedef struct __mavlink_xap_sbg_utc_msg_t {
 uint32_t time_boot_ms; /*< [ms] Timestamp (milliseconds since system boot)*/
 uint32_t nanosec; /*<   Nanosecond of second. ns */
 uint32_t gps_tow; /*<   GPS Time of week, ms */
 uint16_t clock_status; /*<   General UTC time and clock sync status */
 uint16_t year; /*<   Year, year */
 int8_t sbg_id; /*<   Sbg device id */
 uint8_t month; /*<   Month in Year [1 ... 12], month */
 uint8_t day; /*<   Day in Month [1 ... 31], d */
 uint8_t hour; /*<   Hour in day [0 ... 23], h */
 uint8_t min; /*<   Minute in hour [0 ... 59], min */
 uint8_t sec; /*<   Second in minute [0 ... 60] Note 60 is when a leap second is added. s */
} mavlink_xap_sbg_utc_msg_t;

#define MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN 22
#define MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_MIN_LEN 22
#define MAVLINK_MSG_ID_20802_LEN 22
#define MAVLINK_MSG_ID_20802_MIN_LEN 22

#define MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_CRC 69
#define MAVLINK_MSG_ID_20802_CRC 69



#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_XAP_SBG_UTC_MSG { \
    20802, \
    "XAP_SBG_UTC_MSG", \
    11, \
    {  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_xap_sbg_utc_msg_t, time_boot_ms) }, \
         { "sbg_id", NULL, MAVLINK_TYPE_INT8_T, 0, 16, offsetof(mavlink_xap_sbg_utc_msg_t, sbg_id) }, \
         { "clock_status", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_xap_sbg_utc_msg_t, clock_status) }, \
         { "year", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_xap_sbg_utc_msg_t, year) }, \
         { "month", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_xap_sbg_utc_msg_t, month) }, \
         { "day", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_xap_sbg_utc_msg_t, day) }, \
         { "hour", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_xap_sbg_utc_msg_t, hour) }, \
         { "min", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_xap_sbg_utc_msg_t, min) }, \
         { "sec", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_xap_sbg_utc_msg_t, sec) }, \
         { "nanosec", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_xap_sbg_utc_msg_t, nanosec) }, \
         { "gps_tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_xap_sbg_utc_msg_t, gps_tow) }, \
         } \
}
#else
#define MAVLINK_MESSAGE_INFO_XAP_SBG_UTC_MSG { \
    "XAP_SBG_UTC_MSG", \
    11, \
    {  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_xap_sbg_utc_msg_t, time_boot_ms) }, \
         { "sbg_id", NULL, MAVLINK_TYPE_INT8_T, 0, 16, offsetof(mavlink_xap_sbg_utc_msg_t, sbg_id) }, \
         { "clock_status", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_xap_sbg_utc_msg_t, clock_status) }, \
         { "year", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_xap_sbg_utc_msg_t, year) }, \
         { "month", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_xap_sbg_utc_msg_t, month) }, \
         { "day", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_xap_sbg_utc_msg_t, day) }, \
         { "hour", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_xap_sbg_utc_msg_t, hour) }, \
         { "min", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_xap_sbg_utc_msg_t, min) }, \
         { "sec", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_xap_sbg_utc_msg_t, sec) }, \
         { "nanosec", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_xap_sbg_utc_msg_t, nanosec) }, \
         { "gps_tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_xap_sbg_utc_msg_t, gps_tow) }, \
         } \
}
#endif

/**
 * @brief Pack a xap_sbg_utc_msg message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param time_boot_ms [ms] Timestamp (milliseconds since system boot)
 * @param sbg_id   Sbg device id 
 * @param clock_status   General UTC time and clock sync status 
 * @param year   Year, year 
 * @param month   Month in Year [1 ... 12], month 
 * @param day   Day in Month [1 ... 31], d 
 * @param hour   Hour in day [0 ... 23], h 
 * @param min   Minute in hour [0 ... 59], min 
 * @param sec   Second in minute [0 ... 60] Note 60 is when a leap second is added. s 
 * @param nanosec   Nanosecond of second. ns 
 * @param gps_tow   GPS Time of week, ms 
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_xap_sbg_utc_msg_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
                               uint32_t time_boot_ms, int8_t sbg_id, uint16_t clock_status, uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t min, uint8_t sec, uint32_t nanosec, uint32_t gps_tow)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN];
    _mav_put_uint32_t(buf, 0, time_boot_ms);
    _mav_put_uint32_t(buf, 4, nanosec);
    _mav_put_uint32_t(buf, 8, gps_tow);
    _mav_put_uint16_t(buf, 12, clock_status);
    _mav_put_uint16_t(buf, 14, year);
    _mav_put_int8_t(buf, 16, sbg_id);
    _mav_put_uint8_t(buf, 17, month);
    _mav_put_uint8_t(buf, 18, day);
    _mav_put_uint8_t(buf, 19, hour);
    _mav_put_uint8_t(buf, 20, min);
    _mav_put_uint8_t(buf, 21, sec);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN);
#else
    mavlink_xap_sbg_utc_msg_t packet;
    packet.time_boot_ms = time_boot_ms;
    packet.nanosec = nanosec;
    packet.gps_tow = gps_tow;
    packet.clock_status = clock_status;
    packet.year = year;
    packet.sbg_id = sbg_id;
    packet.month = month;
    packet.day = day;
    packet.hour = hour;
    packet.min = min;
    packet.sec = sec;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_XAP_SBG_UTC_MSG;
    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_MIN_LEN, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_CRC);
}

/**
 * @brief Pack a xap_sbg_utc_msg message on a channel
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param time_boot_ms [ms] Timestamp (milliseconds since system boot)
 * @param sbg_id   Sbg device id 
 * @param clock_status   General UTC time and clock sync status 
 * @param year   Year, year 
 * @param month   Month in Year [1 ... 12], month 
 * @param day   Day in Month [1 ... 31], d 
 * @param hour   Hour in day [0 ... 23], h 
 * @param min   Minute in hour [0 ... 59], min 
 * @param sec   Second in minute [0 ... 60] Note 60 is when a leap second is added. s 
 * @param nanosec   Nanosecond of second. ns 
 * @param gps_tow   GPS Time of week, ms 
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_xap_sbg_utc_msg_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
                               mavlink_message_t* msg,
                                   uint32_t time_boot_ms,int8_t sbg_id,uint16_t clock_status,uint16_t year,uint8_t month,uint8_t day,uint8_t hour,uint8_t min,uint8_t sec,uint32_t nanosec,uint32_t gps_tow)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN];
    _mav_put_uint32_t(buf, 0, time_boot_ms);
    _mav_put_uint32_t(buf, 4, nanosec);
    _mav_put_uint32_t(buf, 8, gps_tow);
    _mav_put_uint16_t(buf, 12, clock_status);
    _mav_put_uint16_t(buf, 14, year);
    _mav_put_int8_t(buf, 16, sbg_id);
    _mav_put_uint8_t(buf, 17, month);
    _mav_put_uint8_t(buf, 18, day);
    _mav_put_uint8_t(buf, 19, hour);
    _mav_put_uint8_t(buf, 20, min);
    _mav_put_uint8_t(buf, 21, sec);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN);
#else
    mavlink_xap_sbg_utc_msg_t packet;
    packet.time_boot_ms = time_boot_ms;
    packet.nanosec = nanosec;
    packet.gps_tow = gps_tow;
    packet.clock_status = clock_status;
    packet.year = year;
    packet.sbg_id = sbg_id;
    packet.month = month;
    packet.day = day;
    packet.hour = hour;
    packet.min = min;
    packet.sec = sec;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_XAP_SBG_UTC_MSG;
    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_MIN_LEN, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_CRC);
}

/**
 * @brief Encode a xap_sbg_utc_msg struct
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 * @param xap_sbg_utc_msg C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_xap_sbg_utc_msg_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_xap_sbg_utc_msg_t* xap_sbg_utc_msg)
{
    return mavlink_msg_xap_sbg_utc_msg_pack(system_id, component_id, msg, xap_sbg_utc_msg->time_boot_ms, xap_sbg_utc_msg->sbg_id, xap_sbg_utc_msg->clock_status, xap_sbg_utc_msg->year, xap_sbg_utc_msg->month, xap_sbg_utc_msg->day, xap_sbg_utc_msg->hour, xap_sbg_utc_msg->min, xap_sbg_utc_msg->sec, xap_sbg_utc_msg->nanosec, xap_sbg_utc_msg->gps_tow);
}

/**
 * @brief Encode a xap_sbg_utc_msg struct on a channel
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param xap_sbg_utc_msg C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_xap_sbg_utc_msg_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_xap_sbg_utc_msg_t* xap_sbg_utc_msg)
{
    return mavlink_msg_xap_sbg_utc_msg_pack_chan(system_id, component_id, chan, msg, xap_sbg_utc_msg->time_boot_ms, xap_sbg_utc_msg->sbg_id, xap_sbg_utc_msg->clock_status, xap_sbg_utc_msg->year, xap_sbg_utc_msg->month, xap_sbg_utc_msg->day, xap_sbg_utc_msg->hour, xap_sbg_utc_msg->min, xap_sbg_utc_msg->sec, xap_sbg_utc_msg->nanosec, xap_sbg_utc_msg->gps_tow);
}

/**
 * @brief Send a xap_sbg_utc_msg message
 * @param chan MAVLink channel to send the message
 *
 * @param time_boot_ms [ms] Timestamp (milliseconds since system boot)
 * @param sbg_id   Sbg device id 
 * @param clock_status   General UTC time and clock sync status 
 * @param year   Year, year 
 * @param month   Month in Year [1 ... 12], month 
 * @param day   Day in Month [1 ... 31], d 
 * @param hour   Hour in day [0 ... 23], h 
 * @param min   Minute in hour [0 ... 59], min 
 * @param sec   Second in minute [0 ... 60] Note 60 is when a leap second is added. s 
 * @param nanosec   Nanosecond of second. ns 
 * @param gps_tow   GPS Time of week, ms 
 */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_xap_sbg_utc_msg_send(mavlink_channel_t chan, uint32_t time_boot_ms, int8_t sbg_id, uint16_t clock_status, uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t min, uint8_t sec, uint32_t nanosec, uint32_t gps_tow)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN];
    _mav_put_uint32_t(buf, 0, time_boot_ms);
    _mav_put_uint32_t(buf, 4, nanosec);
    _mav_put_uint32_t(buf, 8, gps_tow);
    _mav_put_uint16_t(buf, 12, clock_status);
    _mav_put_uint16_t(buf, 14, year);
    _mav_put_int8_t(buf, 16, sbg_id);
    _mav_put_uint8_t(buf, 17, month);
    _mav_put_uint8_t(buf, 18, day);
    _mav_put_uint8_t(buf, 19, hour);
    _mav_put_uint8_t(buf, 20, min);
    _mav_put_uint8_t(buf, 21, sec);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG, buf, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_MIN_LEN, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_CRC);
#else
    mavlink_xap_sbg_utc_msg_t packet;
    packet.time_boot_ms = time_boot_ms;
    packet.nanosec = nanosec;
    packet.gps_tow = gps_tow;
    packet.clock_status = clock_status;
    packet.year = year;
    packet.sbg_id = sbg_id;
    packet.month = month;
    packet.day = day;
    packet.hour = hour;
    packet.min = min;
    packet.sec = sec;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG, (const char *)&packet, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_MIN_LEN, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_CRC);
#endif
}

/**
 * @brief Send a xap_sbg_utc_msg message
 * @param chan MAVLink channel to send the message
 * @param struct The MAVLink struct to serialize
 */
static inline void mavlink_msg_xap_sbg_utc_msg_send_struct(mavlink_channel_t chan, const mavlink_xap_sbg_utc_msg_t* xap_sbg_utc_msg)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mavlink_msg_xap_sbg_utc_msg_send(chan, xap_sbg_utc_msg->time_boot_ms, xap_sbg_utc_msg->sbg_id, xap_sbg_utc_msg->clock_status, xap_sbg_utc_msg->year, xap_sbg_utc_msg->month, xap_sbg_utc_msg->day, xap_sbg_utc_msg->hour, xap_sbg_utc_msg->min, xap_sbg_utc_msg->sec, xap_sbg_utc_msg->nanosec, xap_sbg_utc_msg->gps_tow);
#else
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG, (const char *)xap_sbg_utc_msg, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_MIN_LEN, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_CRC);
#endif
}

#if MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
  This varient of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  mavlink_message_t which is the size of a full mavlink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage.
 */
static inline void mavlink_msg_xap_sbg_utc_msg_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, int8_t sbg_id, uint16_t clock_status, uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t min, uint8_t sec, uint32_t nanosec, uint32_t gps_tow)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char *buf = (char *)msgbuf;
    _mav_put_uint32_t(buf, 0, time_boot_ms);
    _mav_put_uint32_t(buf, 4, nanosec);
    _mav_put_uint32_t(buf, 8, gps_tow);
    _mav_put_uint16_t(buf, 12, clock_status);
    _mav_put_uint16_t(buf, 14, year);
    _mav_put_int8_t(buf, 16, sbg_id);
    _mav_put_uint8_t(buf, 17, month);
    _mav_put_uint8_t(buf, 18, day);
    _mav_put_uint8_t(buf, 19, hour);
    _mav_put_uint8_t(buf, 20, min);
    _mav_put_uint8_t(buf, 21, sec);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG, buf, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_MIN_LEN, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_CRC);
#else
    mavlink_xap_sbg_utc_msg_t *packet = (mavlink_xap_sbg_utc_msg_t *)msgbuf;
    packet->time_boot_ms = time_boot_ms;
    packet->nanosec = nanosec;
    packet->gps_tow = gps_tow;
    packet->clock_status = clock_status;
    packet->year = year;
    packet->sbg_id = sbg_id;
    packet->month = month;
    packet->day = day;
    packet->hour = hour;
    packet->min = min;
    packet->sec = sec;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG, (const char *)packet, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_MIN_LEN, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_CRC);
#endif
}
#endif

#endif

// MESSAGE XAP_SBG_UTC_MSG UNPACKING


/**
 * @brief Get field time_boot_ms from xap_sbg_utc_msg message
 *
 * @return [ms] Timestamp (milliseconds since system boot)
 */
static inline uint32_t mavlink_msg_xap_sbg_utc_msg_get_time_boot_ms(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint32_t(msg,  0);
}

/**
 * @brief Get field sbg_id from xap_sbg_utc_msg message
 *
 * @return   Sbg device id 
 */
static inline int8_t mavlink_msg_xap_sbg_utc_msg_get_sbg_id(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int8_t(msg,  16);
}

/**
 * @brief Get field clock_status from xap_sbg_utc_msg message
 *
 * @return   General UTC time and clock sync status 
 */
static inline uint16_t mavlink_msg_xap_sbg_utc_msg_get_clock_status(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint16_t(msg,  12);
}

/**
 * @brief Get field year from xap_sbg_utc_msg message
 *
 * @return   Year, year 
 */
static inline uint16_t mavlink_msg_xap_sbg_utc_msg_get_year(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint16_t(msg,  14);
}

/**
 * @brief Get field month from xap_sbg_utc_msg message
 *
 * @return   Month in Year [1 ... 12], month 
 */
static inline uint8_t mavlink_msg_xap_sbg_utc_msg_get_month(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  17);
}

/**
 * @brief Get field day from xap_sbg_utc_msg message
 *
 * @return   Day in Month [1 ... 31], d 
 */
static inline uint8_t mavlink_msg_xap_sbg_utc_msg_get_day(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  18);
}

/**
 * @brief Get field hour from xap_sbg_utc_msg message
 *
 * @return   Hour in day [0 ... 23], h 
 */
static inline uint8_t mavlink_msg_xap_sbg_utc_msg_get_hour(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  19);
}

/**
 * @brief Get field min from xap_sbg_utc_msg message
 *
 * @return   Minute in hour [0 ... 59], min 
 */
static inline uint8_t mavlink_msg_xap_sbg_utc_msg_get_min(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  20);
}

/**
 * @brief Get field sec from xap_sbg_utc_msg message
 *
 * @return   Second in minute [0 ... 60] Note 60 is when a leap second is added. s 
 */
static inline uint8_t mavlink_msg_xap_sbg_utc_msg_get_sec(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  21);
}

/**
 * @brief Get field nanosec from xap_sbg_utc_msg message
 *
 * @return   Nanosecond of second. ns 
 */
static inline uint32_t mavlink_msg_xap_sbg_utc_msg_get_nanosec(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint32_t(msg,  4);
}

/**
 * @brief Get field gps_tow from xap_sbg_utc_msg message
 *
 * @return   GPS Time of week, ms 
 */
static inline uint32_t mavlink_msg_xap_sbg_utc_msg_get_gps_tow(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint32_t(msg,  8);
}

/**
 * @brief Decode a xap_sbg_utc_msg message into a struct
 *
 * @param msg The message to decode
 * @param xap_sbg_utc_msg C-struct to decode the message contents into
 */
static inline void mavlink_msg_xap_sbg_utc_msg_decode(const mavlink_message_t* msg, mavlink_xap_sbg_utc_msg_t* xap_sbg_utc_msg)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    xap_sbg_utc_msg->time_boot_ms = mavlink_msg_xap_sbg_utc_msg_get_time_boot_ms(msg);
    xap_sbg_utc_msg->nanosec = mavlink_msg_xap_sbg_utc_msg_get_nanosec(msg);
    xap_sbg_utc_msg->gps_tow = mavlink_msg_xap_sbg_utc_msg_get_gps_tow(msg);
    xap_sbg_utc_msg->clock_status = mavlink_msg_xap_sbg_utc_msg_get_clock_status(msg);
    xap_sbg_utc_msg->year = mavlink_msg_xap_sbg_utc_msg_get_year(msg);
    xap_sbg_utc_msg->sbg_id = mavlink_msg_xap_sbg_utc_msg_get_sbg_id(msg);
    xap_sbg_utc_msg->month = mavlink_msg_xap_sbg_utc_msg_get_month(msg);
    xap_sbg_utc_msg->day = mavlink_msg_xap_sbg_utc_msg_get_day(msg);
    xap_sbg_utc_msg->hour = mavlink_msg_xap_sbg_utc_msg_get_hour(msg);
    xap_sbg_utc_msg->min = mavlink_msg_xap_sbg_utc_msg_get_min(msg);
    xap_sbg_utc_msg->sec = mavlink_msg_xap_sbg_utc_msg_get_sec(msg);
#else
        uint8_t len = msg->len < MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN? msg->len : MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN;
        memset(xap_sbg_utc_msg, 0, MAVLINK_MSG_ID_XAP_SBG_UTC_MSG_LEN);
    memcpy(xap_sbg_utc_msg, _MAV_PAYLOAD(msg), len);
#endif
}
